14. Fourier Transform in Review

heading

Fourier Transform In Review

In this class we will be computing the Fourier transform by using a method called the Fast Fourier Transform. This is a clever algorithm that is able to compute the Fourier transform in O(n*log(n)) time instead of quadratic time. We use numpy’s implementation of this algorithm with the functions:

  • rfft
  • rfftfreq
  • irfft

We then saw how we could remove the noise by filtering out frequency components outside of the bandwidth of the signal. The process of removing frequencies from a signal outside a specific band is known as bandpass filtering. The band of frequencies that we want to preserve is called the passband. -- or bandpass filtering our signal. We did this first by manipulating the signal in the frequency domain. After seeing the short-falls of this method, we explored using traditional bandpass filtering techniques that process the signal in the time-domain.

Quizzes

If we take the Fourier transform of a 50Hz signal that is 100 samples long using np.fft.rfft, what frequencies will the Fourier coefficients correspond to?

SOLUTION: 0 - 25 Hz in intervals of 0.5 Hz

Fourier Transform Further Research

Further Resources

3Blue1Brown is a great YouTube channel that explains mathematical concepts with beautiful animations that make intuitive understanding so much easier. He has a few videos on the Fourier transform, which are absolutely illuminating. I highly recommend exploring this channel, starting with this video, But what is the Fourier Transform? A visual introduction.

New Vocabulary

  • Frequency-domain: A representation of a signal over frequency instead of time. Instead of representing the signal as a series of numbers in time, the signal is represented by the frequency components that make it up.
  • Bandpass filter: A function that preserves frequency components of a signal within a band and suppresses the frequency components outside that band.

Heading

# Exercise 3: Fourier Transform

Instructions

  1. Complete the Offline or Online instructions below.
  2. Read through the whole .ipynb.
  3. Complete all the code cells that contain ## Your Code Goes Here.
  4. Complete all the markdown cells that contain TODO.

Offline

  1. In the repo which you can access here in the repo /intro-to-dsp/exercises/3-fourier-transform/ you should find the following files
    • 3_fourier_transform.ipynb
    • exercise3.npz
  2. Open up the python notebook and associated files in your desired editor.

Note: Instructions can be found in Introduction to Wearable Data's Concept Developer Workflow for how to set up your local environment.

Online

  1. Go to the next concept and the 3_fourier_transform.ipynb should be open and the workspace should already contain the appropriate exercise3.npz file.